package org.edu.modules.growth.config;

import lombok.Getter;


@Getter
public enum TrainTypeEnum {

    TYPE1("培训",1),
    TYPE2("下企业实践",2),
    TYPE3("教科研项目",3),
    TYPE4("学术交流",4),
    TYPE5("课程开发",5),
    TYPE6("教材编写",6),
    TYPE7("进修",7),
    TYPE8("其它",8);

    private final String typeName;

    private final int typeVal;

    TrainTypeEnum (String typeName, int typeVal) {
        this.typeName = typeName;
        this.typeVal = typeVal;
    }

    //通过vale-获取name
    public static String getNameByValue(Integer value) {
        if( value != null ){
            for (TrainTypeEnum v : TrainTypeEnum.values()) {
                if (value == v.getTypeVal()) {
                    return v.getTypeName();
                }
            }
        }
        return null ;
    }

}
